// 十进制转二进制（递归）
#include <stdio.h>

void Int_to_Bin(unsigned long n);

int main(void)
{
    unsigned long number;
    printf("请输入一个大于0的整数：\n");
    while (scanf("%ul", &number) == 1)
    {
        printf("转换为二进制数为：   ");
        Int_to_Bin(number);
        putchar('\n');
    }
    return 0;
}

void Int_to_Bin(unsigned long n) //递归函数
{
    int r;
    r = n % 2;
    if (n >= 2)
        Int_to_Bin(n / 2);
    putchar('0' + r);
}
